home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / GraphicsWrap / Source / AbsPoly.m < prev    next >
Text File  |  1991-09-17  |  746b  |  51 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "AbsPoly.h"
  5. #import <objc/List.h>
  6. #import "miscutil.h"
  7.  
  8. #import "CmdBgnpoly.h"
  9. #import "CmdVertex.h"
  10. #import "CmdEndpoly.h"
  11.  
  12. @implementation AbsPoly
  13. - init
  14. {
  15.   [super init];
  16.   vertexList=[[List alloc] init];
  17.   command="Polygon";
  18.   return self;
  19. }
  20.  
  21. - addCommand:aCmd
  22. {
  23.   [vertexList addObject:aCmd];
  24.   return self;
  25. }
  26.  
  27. - commandList { return vertexList; }
  28.  
  29. - free
  30. {
  31.   [vertexList free];
  32.   return self;
  33. }
  34.  
  35. - doCmd
  36. {
  37.   [theBitmap cmdDrawPoly:[vertexList copy]];
  38.   return self;
  39. }
  40.  
  41. - (char *)emitCmd
  42. {
  43.   int i, max=[vertexList count];
  44.   char tCmd[8192];
  45.   strcpy(tCmd, [[vertexList objectAt:0] emitCmd]);
  46.   for(i=1;i<max;i++)
  47.      strcat(tCmd,[[vertexList objectAt:i] emitCmd]);
  48.   return strdup(tCmd);
  49. }
  50. @end
  51.